__author__ = 'PROT' import numpy as np import pandas as pd from pandas_datareader import data as wb import matplotlib.pyplot as plt ticker = 'GOOG' data = pd.DataFrame() #can import stock returns data[ticker] = wb.DataReader(ticker, data_source = 'yahoo', start = '2020-6-30', end = '2020-12-31')['Adj Close'] #put your path here for the first extract data.to_excel(r'C:\Users\XXXXXXXXXXXXX\StockPriceExtract1.xls') ticker = 'TSLA' data = pd.DataFrame() #can import stock returns data[ticker] = wb.DataReader(ticker, data_source = 'yahoo', start = '2020-6-30', end = '2020-12-31')['Adj Close'] #put your path here for the second extract data.to_excel(r'C:\Users\XXXXXXXXXXXXX\StockPriceExtract2.xls') #you can add other tickers or build a loop and fill all in the dataframe to extract